import 'package:get/get.dart';
import 'package:oli/bean/UserInfo.dart';

import 'state.dart';

class MineLogic extends GetxController {
  final MineState state = MineState();
  // 模拟从后端获取数据的方法
  void fetchUserInfo() async {
    // 这里模拟网络请求延迟
    await Future.delayed(const Duration(seconds: 3));
    state.userInfo.value = UserInfo(
      nickname: '张三',
      avatarUrl: 'https://via.placeholder.com/150',
      email: 'zhangsan@example.com',
      vehicleVins: ['1HGFC1F3XFA123456', '2HGFC1F3XFA789012'],
      memberLevel: 3,
      isMember: true,
    );
    state.isLoggedIn.value = true;
  }
}
